<%@ page import="ihotel.Hospedagem" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'hospedagem.label', default: 'Checkout')}" />
		<title><g:message code="default.edit.label" args="[entityName]"/></title>
	</head>
	<body>
		<a href="#edit-hospedagem" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
				<li><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></li>
				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
			</ul>
		</div>
		<div id="edit-hospedagem" class="content scaffold-edit" role="main">
			<h1><g:message code="default.edit.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${hospedagemInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${hospedagemInstance}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
			</g:hasErrors>
			<g:form method="post" >
				<g:hiddenField name="id" value="${hospedagemInstance?.id}" />
				<g:hiddenField name="version" value="${hospedagemInstance?.version}" />
				<fieldset class="form">
				
				
				<g:if test="${hospedagemInstance?.numeroQuarto}">
				<li class="fieldcontain">
					<span id="numeroQuarto-label" class="property-label"><g:message code="hospedagem.numeroQuarto.label" default="Numero Quarto" /></span>
					
						<span class="property-value" aria-labelledby="numeroQuarto-label"><g:fieldValue bean="${hospedagemInstance}" field="numeroQuarto"/></span>
					
				</li>
				</g:if>
			
				
				
				<g:if test="${hospedagemInstance?.hospede}">
				<li class="fieldcontain">
					<span id="hospede-label" class="property-label"><g:message code="hospedagem.hospede.label" default="Hospede" /></span>
					
						<span class="property-value" aria-labelledby="hospede-label"><g:link controller="hospede" action="show" id="${hospedagemInstance?.hospede?.id}">${hospedagemInstance?.hospede?.nome.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>
				
				
				<div class="fieldcontain ${hasErrors(bean: hospedagemInstance, field: 'dataCheckout', 'error')} required">
					<label for="dataCheckout">
						<g:message code="hospedagem.dataCheckout.label" default="Data Checkout" />
						<span class="required-indicator">*</span>
					</label>
					<g:datePicker name="dataCheckout" precision="day"  value="${hospedagemInstance?.dataCheckout}"  />
				</div>
				
				
				<g:if test="${hospedagemInstance?.dataCheckin}">
				<li class="fieldcontain">
					<span id="dataCheckin-label" class="property-label"><g:message code="hospedagem.dataCheckin.label" default="Data Checkin" /></span>
					
						<span class="property-value" aria-labelledby="dataCheckin-label"><g:formatDate date="${hospedagemInstance?.dataCheckin}" /></span>
					
				</li>
				</g:if>
				
				
				<div class="fieldcontain ${hasErrors(bean: hospedagemInstance, field: 'totalDiaria', 'error')} required">
					<label for="totalDiaria">
						<g:message code="hospedagem.totalDiaria.label" default="Total Diaria" />
						<span class="required-indicator">*</span>
					</label>
					<g:field name="totalDiaria" type="number" value="${hospedagemInstance.totalDiaria}" required=""/>
				</div>
				
				<div class="fieldcontain ${hasErrors(bean: hospedagemInstance, field: 'valorDiaria', 'error')} required">
					<label for="valorDiaria">
						<g:message code="hospedagem.valorDiaria.label" default="Valor Diaria" />
						<span class="required-indicator">*</span>
					</label>
					<g:field name="valorDiaria" type="number" value="${fieldValue(bean: hospedagemInstance, field: 'valorDiaria')}" required=""/>
				</div>				
				
				<div class="fieldcontain ${hasErrors(bean: hospedagemInstance, field: 'totalPagar', 'error')} required">
					<label for="totalPagar">
						<g:message code="hospedagem.totalPagar.label" default="Total Pagar" />
						<span class="required-indicator">*</span>
					</label>
					<g:field name="totalPagar" type="number" value="${fieldValue(bean: hospedagemInstance, field: 'totalPagar')}" required=""/>
				</div>				
				
				<div class="fieldcontain ${hasErrors(bean: hospedagemInstance, field: 'finalizado', 'error')} required">
					<label for="finalizado">
						<g:message code="hospedagem.finalizado.label" default="Finalizado" />
						<span class="required-indicator">*</span>
					</label>
					<g:checkBox name="finalizado" value="${hospedagemInstance.finalizado}" required=""/>
				</div>

				</fieldset>
				<fieldset class="buttons">
					<g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
					
				</fieldset>
			</g:form>
		</div>
	</body>
</html>
